<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {% load static %}
    <link rel="stylesheet" type="text/css" href="{% static "css/index.css" %}">
    <script type="text/javascript" src="{% static "js/index.js" %}"></script>
    <title>Python电子计算器</title>
</head>
<body>

<form method="post" action="/calulator/">
    {% csrf_token %}
    <div>请输入:</div>
    <div><input type="text" class="inputtext90width" id="express" name="express" placeholder="请输入Python表达式" value="{{ express }}"/></div>
    <div><input type="button" value="清 空" onclick="clearExpressContent()">
        <input type="submit" value="计算结果"></div>
</form>
<h1>计算结果:</h1>
{% if express == "" %}
    <div style="color: red">输入内容为空，请输入数据!!!</div>
{% else %}
    <div style="color: green">{{ express }} = </div>
{% endif %}

{% if calcresult != "" %}
    <hr/>
    {{ calcresult }}
{% endif %}

</body>
</html>